package com.lizardmind.haofudoctor.ui.diagnosis.sickMan.advisory.kaifang.addChuFang

import android.os.Bundle
import android.view.View
import com.linxiao.framework.activity.BaseActivity
import com.linxiao.framework.util.color
import com.linxiao.framework.util.getBaseFragmentStatePagerAdapter
import com.linxiao.framework.util.getDataBinding
import com.linxiao.framework.widget.NavigationView
import com.lizardmind.haofudoctor.R
import com.lizardmind.haofudoctor.databinding.ActivityAddChuFangBinding
import kotlinx.android.synthetic.main.activity_add_chu_fang.*
import kotlinx.android.synthetic.main.include_title_text.*
import org.jetbrains.anko.sdk25.coroutines.onClick

//添加处方
class AddChuFangActivity : BaseActivity() {

    private val listFragment= arrayListOf(JingFangFragment(),MyCustomChuFangFragment())

    private val binding by lazy { getDataBinding<ActivityAddChuFangBinding>(R.layout.activity_add_chu_fang) }
    override fun onCreatRootView(): View? {
        return binding.root
    }

    override fun onInitView(savedInstanceState: Bundle?) {
        VPager_AddChuFang.setScanScroll(false)
        VPager_AddChuFang.adapter= getBaseFragmentStatePagerAdapter(supportFragmentManager,listFragment)
        naView_AddChuFang.binding(VPager_AddChuFang)
                .setTextViewChildTextFromString(resources.getStringArray(R.array.add_chufang))
                .setUnSelectTextColor(color(R.color.gray3))
                .setSelectTextColor(color(R.color.notice_red))
                .setTextSize(16f)//文字大小，单位为sp，默认为42px
                .setSlidingStripPosition(NavigationView.BOTTOM)
                .setScllorHeight(2f)
                .setScllorColor(color(R.color.notice_red))
                .commit()//提交，执行修改

        titleText.text="添加处方"
        imgLeft.setImageResource(R.mipmap.back)
        imgLeft.onClick { finish() }

    }

}
